# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=ukui-screensaver
pkgver=3.0.2
pkgrel=5
pkgdesc="Screensaver for UKUI desktop environment"
arch=('loong64' 'x86_64')
license=('GPL')
url="https://github.com/ukui/ukui-screensaver"
groups=('ukui')
depends=('dconf' 'gsettings-qt' 'libxtst' 'opencv' 'qt5-svg' 'qt5-x11extras')
makedepends=('cmake' 'qt5-tools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ukui/ukui-screensaver/archive/v$pkgver.tar.gz")
sha512sums=('5d7af2f2d2903bf5f6e337223e9f4a29069e76b3aec448289efbec16de1e24a0c040ad537aef15bf532abc4305e3bb618950bdaf8346de217408126258643596')

prepare() {
  mkdir -p build
  # https://github.com/ukui/ukui-screensaver/issues/65
  cp /etc/pam.d/login $pkgname-$pkgver/data/ukui-screensaver-qt
  sed -e 's|gio-unix-2.0|glib-2.0|' -i $pkgname-$pkgver/BiometricAuth/giodbus.cpp
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
